﻿using System;

namespace 冒泡排序
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] a = new int[] { 9, 8, 7, 6, 5 };

			for (int j = 1; j < a.Length; j++)
			{
				for (int i = 0; i < a.Length-j; i++)
				{
					if (a[i] > a[i + 1])
					{
						int t = a[i];
						a[i] = a[i + 1];
						a[i + 1] = t;
					}
				}

				Console.WriteLine("---第{0}轮比较结果入下----",j);
				for(int i = 0; i < a.Length; i++)
				{
					Console.WriteLine(a[i]);
				}
			}
		}
	}
}
